﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Text;

namespace JX.Infrastructure.Consul
{
    /// <summary>
    /// Consul配置模型类
    /// </summary>
    public class ConsulConfig
    {
        /// <summary>
        /// 服务注册地址（Consul的地址）
        /// </summary>
        [DisplayFormat(ConvertEmptyStringToNull = false)]
        public string ConsulAddress { get; set; } = string.Empty;

        /// <summary>
        /// 服务ID
        /// </summary>
        [DisplayFormat(ConvertEmptyStringToNull = false)]
        public string ServiceId { get; set; } = string.Empty;

        /// <summary>
        /// 服务名称
        /// </summary>
        [DisplayFormat(ConvertEmptyStringToNull = false)]
        public string ServiceName { get; set; } = string.Empty;

        /// <summary>
        /// 服务地址，为空则自动从应用程序中获取，有时会失效
        /// </summary>
        [DisplayFormat(ConvertEmptyStringToNull = false)]
        public string ServiceAddress { get; set; } = string.Empty;

        /// <summary>
        /// 健康检查地址
        /// </summary>
        [DisplayFormat(ConvertEmptyStringToNull = false)]
        public string HealthCheck { get; set; } = string.Empty;
    }
}
